<?php
  include_once('../conn.php');

  // 接收由登录页面传来的数据
  $id = $_POST['id'];
  $limits = @array($_POST['limit0'], $_POST['limit1'], $_POST['limit2'], $_POST['limit3'], $_POST['limit4'], $_POST['limit5']);
  $limits = implode(" ", $limits);
  $sql = "update user set 
    limits = '$limits'
    where id = $id
    ";
  // echo $sql;
  $result = mysqli_query($conn, $sql);
  if($result) {
    alert('修改成功', 'limits_list.php');
  } else {
    alert('修改失败', 'limits_list.php');
  }

  mysqli_close($conn);
?>